package com.cmcc.example.face.noSdk.common.vo.request;

import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
import sun.misc.BASE64Encoder;

import java.io.IOException;
import java.io.Serializable;

/**
 * <p>
 * <name>FaceCreateVO</name>
 * 人脸创建请求对象
 * </p >
 *
 * @author arabira
 * @version 1.0 2020-04-13
 * @since 1.0
 */
@Data
public class FaceCreateVO implements Serializable {
    private static final long serialVersionUID = -6413454649204009468L;
    private String faceName;
    private int faceSetId;
    private String faceExtraInfo;
    private String imageFile;

    public FaceCreateVO() {
    }


    public FaceCreateVO(String userName, int faceSetId, MultipartFile image) throws IOException {
        this.faceName = userName;
        this.faceSetId = faceSetId;
        this.imageFile = new BASE64Encoder().encode(image.getBytes());
    }
}